package cn.com.bluemoon.daps.common.datascope.config;

import cn.com.bluemoon.daps.common.datascope.log.wrapper.OperateLogFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 注册过滤器服务配置类
 */
@Configuration
public class FilterConfig {

    @Bean
    public FilterRegistrationBean<OperateLogFilter> Filters() {
        FilterRegistrationBean<OperateLogFilter> registrationBean = new FilterRegistrationBean<>();
        registrationBean.setFilter(new OperateLogFilter());
        registrationBean.addUrlPatterns("/*");
        registrationBean.setName("readRequestBody-filter");
        registrationBean.setOrder(1);
        return registrationBean;
    }
}
